<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Dag &mdash; SystemDS 3.3.0-dev documentation</title>
      <link rel="stylesheet" type="text/css" href="../../static/pygments.css?v=80d5e7a1" />
      <link rel="stylesheet" type="text/css" href="../../static/css/theme.css?v=19f00094" />

  
  <!--[if lt IE 9]>
    <script src="../../static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../../static/jquery.js?v=5d32c60e"></script>
        <script src="../../static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="../../static/documentation_options.js?v=492a8e1f"></script>
        <script src="../../static/doctools.js?v=9a2dae69"></script>
        <script src="../../static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../../static/js/theme.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Script" href="script.html" />
    <link rel="prev" title="Operation Node" href="../operator/operation_node.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../../index.html" class="icon icon-home">
            SystemDS
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Getting Started:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/install.html">Install SystemDS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/simple_examples.html">QuickStart</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Guides</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../guide/federated.html">Federated Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../guide/algorithms_basics.html">Built-in Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../guide/python_end_to_end_tut.html">Python end-to-end tutorial</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../context/systemds_context.html">SystemDSContext</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/algorithms.html">Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/matrix.html">Matrix</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/frame.html">Frame</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/list.html">List</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/scalar.html">Scalar</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/source.html">Source</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Internals API</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../operator/operation_node.html">Operation Node</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Dag</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#systemds.script_building.dag.DAGNode"><code class="docutils literal notranslate"><span class="pre">DAGNode</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#systemds.script_building.dag.DAGNode.code_line"><code class="docutils literal notranslate"><span class="pre">DAGNode.code_line()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#systemds.script_building.dag.DAGNode.compute"><code class="docutils literal notranslate"><span class="pre">DAGNode.compute()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#systemds.script_building.dag.DAGNode.get_lineage_trace"><code class="docutils literal notranslate"><span class="pre">DAGNode.get_lineage_trace()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#systemds.script_building.dag.DAGNode.pass_python_data_to_prepared_script"><code class="docutils literal notranslate"><span class="pre">DAGNode.pass_python_data_to_prepared_script()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="script.html">Script</a></li>
<li class="toctree-l1"><a class="reference internal" href="../utils/converters.html">Converters</a></li>
<li class="toctree-l1"><a class="reference internal" href="../utils/helpers.html">Helpers</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">SystemDS</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">Dag</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../sources/api/script_building/dag.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="dag">
<h1>Dag<a class="headerlink" href="#dag" title="Link to this heading"></a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>OPS! For internal use!</p>
</div>
<dl class="py class" id="module-systemds.script_building.dag">
<dt class="sig sig-object py" id="systemds.script_building.dag.DAGNode">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">systemds.script_building.dag.</span></span><span class="sig-name descname"><span class="pre">DAGNode</span></span><a class="headerlink" href="#systemds.script_building.dag.DAGNode" title="Link to this definition"></a></dt>
<dd><p>A Node in the directed-acyclic-graph (DAG) defining all operations.</p>
<dl class="py method">
<dt class="sig sig-object py" id="systemds.script_building.dag.DAGNode.code_line">
<span class="sig-name descname"><span class="pre">code_line</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">var_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unnamed_input_vars</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Sequence</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">named_input_vars</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="headerlink" href="#systemds.script_building.dag.DAGNode.code_line" title="Link to this definition"></a></dt>
<dd><p>Generates the DML code line equal to the intended action of this node.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var_name</strong> – Name of DML-variable this nodes result should be saved in</p></li>
<li><p><strong>unnamed_input_vars</strong> – all strings representing the unnamed parameters</p></li>
<li><p><strong>named_input_vars</strong> – all strings representing the named parameters (name value pairs)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the DML code line that is equal to this operation</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="systemds.script_building.dag.DAGNode.compute">
<span class="sig-name descname"><span class="pre">compute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lineage</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Any</span></span></span><a class="headerlink" href="#systemds.script_building.dag.DAGNode.compute" title="Link to this definition"></a></dt>
<dd><p>Get result of this operation. Builds the dml script and executes it in SystemDS, before this method is called
all operations are only building the DAG without actually executing (lazy evaluation).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>verbose</strong> – Can be activated to print additional information such as created DML-Script</p></li>
<li><p><strong>lineage</strong> – Can be activated to print lineage trace till this node</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the output as an python builtin data type or numpy array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="systemds.script_building.dag.DAGNode.get_lineage_trace">
<span class="sig-name descname"><span class="pre">get_lineage_trace</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="headerlink" href="#systemds.script_building.dag.DAGNode.get_lineage_trace" title="Link to this definition"></a></dt>
<dd><p>Get lineage trace of this operation. This executes the dml script but unlike compute,
doesn’t store the results</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="systemds.script_building.dag.DAGNode.pass_python_data_to_prepared_script">
<span class="sig-name descname"><span class="pre">pass_python_data_to_prepared_script</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jvm</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">JVMView</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">var_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prepared_script</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">JavaObject</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="headerlink" href="#systemds.script_building.dag.DAGNode.pass_python_data_to_prepared_script" title="Link to this definition"></a></dt>
<dd><p>Passes data from python to the prepared script object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>jvm</strong> – the java virtual machine object</p></li>
<li><p><strong>var_name</strong> – the variable name the data should get in java</p></li>
<li><p><strong>prepared_script</strong> – the prepared script</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../operator/operation_node.html" class="btn btn-neutral float-left" title="Operation Node" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="script.html" class="btn btn-neutral float-right" title="Script" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2024, Apache SystemDS.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>